package br.com.cnpv.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import sun.misc.BASE64Encoder;

/**
 * 
 * @author MARCUS SOUZA - 21 7860-2208
 *
 */

public class EncriptaSenha 
{     
	public static String encripta (String senha) 
	{     
		try 
		{     
			MessageDigest digest = MessageDigest.getInstance("MD5");      
			digest.update(senha.getBytes());      
			BASE64Encoder encoder = new BASE64Encoder ();      
			return encoder.encode (digest.digest ());      
		} catch (NoSuchAlgorithmException ns) 
		{     
			ns.printStackTrace ();      
			return senha;      
		}      
	}      
}   